package com.rk.kbk.dao;

import com.rk.kbk.model.RideTest;
import com.rk.kbk.model.Test;
import com.rk.kbk.model.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * @RideTestDao
 * @骑手测试Dao
 * @version : Ver 1.0
 */
public interface RideTestDao extends JpaRepository<RideTest, Long>,JpaSpecificationExecutor {
    /**
     * 根据骑手id和测试id、测试题状态查询数据
     */
    List<RideTest> findByRideAndAndStatusAndTestIn(User ride, int status,List<Test> test);

    /**
     * 根据骑手id和状态获取成绩列表
     */
    List<RideTest> findByRideAndStatus(User ride,int status);

    List<RideTest> findByTest(Test test);

}
